/*
 * OrderDetailShopActiveListItem.java
 * business
 *
 * Created by SunDing on 2016/12/10.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.listview.displaylistitem;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;

import com.yidiandao.business.data.bean.Order;
import com.yidiandao.business.ui.widget.listview.DisplayListItem;
import com.yidiandao.business.ui.widget.listview.viewholder.OrderDetailShopActiveHolder;

/**
 * 订单详情 订单活动显示
 */
public class OrderDetailShopActiveListItem
        extends DisplayListItem<OrderDetailShopActiveHolder, Order> {

    public OrderDetailShopActiveListItem(Order s) {
        super(s);
    }

    @Override
    public void onShow(Context context, OrderDetailShopActiveHolder holder) {

        holder.mActiveLayout.setData(data.getFavourableList());
        if (null != data.getCouponInfo() && !TextUtils.isEmpty(data.getCouponInfo().getTitle())) {
            holder.mTvActive.setVisibility(View.VISIBLE);
            holder.mTvActiveTitle.setText(data.getCouponInfo().getTitle());
            holder.mTvActiveInfo.setText(data.getCouponInfo().getContent());
        } else {
            holder.mTvActive.setVisibility(View.GONE);
        }
    }

    @Override
    public String getDisplayItemTag() {
        return OrderDetailShopActiveListItem.class.getSimpleName();
    }

    @Override
    public Class<OrderDetailShopActiveHolder> getViewHolderClazz() {
        return OrderDetailShopActiveHolder.class;
    }
}
